Lyon
A path tessellation library written in rust for GPU-based 2D graphics rendering.
Motivation
For now the goal is to provide efficient SVG-compliant path tessellation tools to help with rendering vector graphics on the GPU. For now think of this library as a way to turn complex paths into triangles for use in your own rendering engine.
The intent is for this library to be useful in projects like Servo and games.
Example
extern crate lyon;
use ;
use Path;
use *;
use *;
FAQ
In a nutshell, what is a tessellator?
Tessellators such as the ones provided by lyon take complex shapes as input and generate geometry made of triangles that can be easily consumed by graphics APIs such as OpenGL, Vulkan or D3D.
How do I render an SVG file with lyon?
Lyon is not an SVG renderer. For now lyon mainly provides primitives to tessellate complex path fills and strokes in a way that is convenient to use with GPU APIs such as gfx-rs, glium, OpenGL, D3D, etc. How the tessellated geometry is rendered is completely up to the user of this crate.
How do I render the output of the tessellators?
Although the format of the output of the tessellators is customizable, the algorithms are designed to generate a vertex and an index buffer. See the lyon::tessellation documentation for more details.
Is anti-aliasing supported?
There is currently no built-in support for anti-aliasing in the tessellators. Anti-aliasing can still be achieved by users of this crate using techniques commonly employed in video games (msaa, taa, fxaa, etc.).
What is left to do before lyon 1.0?
See the 1.0 milestone on the github repository.
I need help!
Don't hesitate to file an issue, ask questions on gitter, or contact @nical by e-mail.
How can I help?
See CONTRIBUTING.md.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Mozilla Public License 2.0
at your option.
Dual MIT/Apache2 is strictly more permissive
Contribution
There is useful information for contributors in the contribution guidelines.